﻿<UserControl 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"  
    x:Class="TM.QWeibo.Client.UserControls.Dialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:es="clr-namespace:Microsoft.Expression.Shapes;assembly=Microsoft.Expression.Drawing" 
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
	<UserControl.Resources>
        <DataTemplate x:Key="RecvPopTemplate">
			<Grid Width="460" Margin="0,0,0,24" HorizontalAlignment="Left">
    				 <Grid.RowDefinitions>
                        <RowDefinition Height="8" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                <es:RegularPolygon  Style="{StaticResource PrivateMessageRevcArrow}">
                        <es:RegularPolygon.RenderTransform>
                            <CompositeTransform SkewX="37"/>
                        </es:RegularPolygon.RenderTransform>
                    </es:RegularPolygon>
                <Grid Grid.Row="1" Style="{StaticResource PrivateMessageRevcBox}">
                    	<StackPanel>
                            <TextBlock Text="{Binding Origtext}" Style="{StaticResource  PrivateMessageText}"/>
                            <TextBlock Text="{Binding PublishTime}" Style="{StaticResource  PrivateMessageMeta}"/>
						</StackPanel>
                    </Grid>			
				</Grid>
        </DataTemplate>
        <DataTemplate x:Key="SendPopTemplate">
			<Grid Width="460" Margin="30,0,0,24" HorizontalAlignment="Left">
    				 <Grid.RowDefinitions>
                        <RowDefinition />
						<RowDefinition Height="8" />
                    </Grid.RowDefinitions>
                <es:RegularPolygon Style="{StaticResource PrivateMessageSendArrow}" Grid.Row="1" InnerRadius="1" UseLayoutRounding="False">
                    	<es:RegularPolygon.Projection>
                    		<PlaneProjection RotationX="180"/>
                    	</es:RegularPolygon.Projection>
                        <es:RegularPolygon.RenderTransform>
                            <CompositeTransform SkewX="37"/>
                        </es:RegularPolygon.RenderTransform>
                    </es:RegularPolygon>
                <Grid Grid.Row="0" Style="{StaticResource PrivateMessageSendBox}">
                    	<StackPanel>
                            <TextBlock Text="{Binding Origtext}" Style="{StaticResource  PrivateMessageText}"/>
                            <TextBlock Text="{Binding PublishTime}" Style="{StaticResource  PrivateMessageMeta}"/>
                        </StackPanel>
                    </Grid>			
			</Grid>
        </DataTemplate>
        <!--头部模板-->
        <DataTemplate x:Key="ListHeaderTemplate">
            <Grid Style="{StaticResource ListHeaderGrid}">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <Image Source="/Resource/Images/pull.png" Width="32" Height="32" VerticalAlignment="Center"/>
                    <TextBlock x:Name="tbHeaderText" Style="{StaticResource ListHeaderText}"/>
                </StackPanel>
            </Grid>
        </DataTemplate>
        <!--底部模板-->
        <DataTemplate x:Key="ListFooterTemplate">
            <Grid Style="{StaticResource ListFooterGrid}">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <TextBlock x:Name="tbFooterText" Style="{StaticResource ListFooterText}"/>
                </StackPanel>
            </Grid>
        </DataTemplate>
        
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent" Style="{StaticResource ListLayoutGrid}">
        <toolkit:LongListSelector x:Name="DataListBox"
                                  Background="Transparent" 
                                  toolkit:TiltEffect.IsTiltEnabled="True"
                                  IsFlatList="True"
                                  ItemTemplate="{StaticResource RecvPopTemplate}"
                                  ListHeaderTemplate="{StaticResource ListHeaderTemplate}"
                                  ListFooterTemplate="{StaticResource ListFooterTemplate}"
                                  ShowListHeader="False"
                                  ShowListFooter="False"
                                  Width="460"
                                  >
            <toolkit:GestureService.GestureListener>
                <toolkit:GestureListener  GestureCompleted="GestureListener_GestureCompleted"  GestureBegin="GestureListener_GestureBegin" />
            </toolkit:GestureService.GestureListener>
        </toolkit:LongListSelector>
    </Grid>
</UserControl>
